﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

/// <summary>
/// Summary description for BUS_Menu
/// </summary>
public class BUS_Menu
{
    DAL_Menu dalMenu = new DAL_Menu();

    public DataTable Menu_GetById(string Id)
    {
        DataTable dtMenu = new DataTable();

        try
        {
            dtMenu = dalMenu.Menu_GetById(Id);
        }
        catch (Exception)
        {
            throw;
        }
        return dtMenu;

    }
    public DataTable Menu_GetByIdAllStatus(string Id)
    {
        DataTable dtMenu = new DataTable();

        try
        {
            dtMenu = dalMenu.Menu_GetByIdAllStatus(Id);
        }
        catch (Exception)
        {
            throw;
        }
        return dtMenu;

    }
    public DataTable Menu_GetByParentId(string Id)
    {
        DataTable dtMenu = new DataTable();

        try
        {
            dtMenu = dalMenu.Menu_GetByParentId(Id);
        }
        catch (Exception)
        {
            throw;
        }
        return dtMenu;

    }
    public DataTable getMenuAllStatus(int location)
    {
        DataTable dtMenu = new DataTable();

        try
        {
            dtMenu = dalMenu.getMenuAllStatus(location);
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        return dtMenu;

    }
    public DataTable getMenu(int location)
    {
        DataTable dtMenu = new DataTable();
       
        try
        {
            dtMenu = dalMenu.getMenu(location);
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        return dtMenu;

    }
    public DataTable getSubMenu(string parentId)
    {
        DataTable dtMenu = new DataTable();

        try
        {
            dtMenu = dalMenu.getSubMenu(parentId);
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        return dtMenu;

    }
    public void Menu_UpdateByAll(string Id, DTO_Menu obj)
    {

        try
        {
            dalMenu.Menu_UpdateByAll(Id, obj);
        }
        catch (Exception)
        {

            throw;
        }
    }
    public void Menu_Delete(string Id)
    {

        try
        {
            dalMenu.Menu_Delete(Id);
        }
        catch (Exception)
        {

            throw;
        }

    }
    public void Menu_Insert(DTO_Menu obj)
    {

        try
        {
            dalMenu.Menu_Insert(obj);
        }
        catch (Exception)
        {

            throw;
        }

    }
}